subroutine DYE_init( )
use prec
use cell
use general
implicit none
   !----------------------------------------------------------------------------
   integer  :: i, moltype
   !----------------------------------------------------------------------------
   subnamep = subname
   subname  = 'DYE_init'
   !
   if ( allocated( bondsMol  ) ) deallocate( bondsMol  )
   if ( allocated( anglsMol  ) ) deallocate( anglsMol  )
   if ( allocated( dihrsMol  ) ) deallocate( dihrsMol  )
   if ( allocated( attypMol  ) ) deallocate( attypMol  )
   if ( allocated( atposMol  ) ) deallocate( atposMol  )
   if ( allocated( molIDMol  ) ) deallocate( molIDMol  )
   if ( allocated( rotatedMol) ) deallocate( rotatedMol)
   if ( allocated( chargeMol ) ) deallocate( chargeMol )
   if ( allocated( EMass     ) ) deallocate( EMass     )
   if ( allocated( sigma     ) ) deallocate( sigma     )
   if ( allocated( epison    ) ) deallocate( epison    )
   if ( allocated( bondcoef  ) ) deallocate( bondcoef  )
   if ( allocated( anglcoef  ) ) deallocate( anglcoef  )
   if ( allocated( torscoef  ) ) deallocate( torscoef  )
   if ( allocated( DistMin   ) ) deallocate( DistMin   )
   if ( allocated( EName     ) ) deallocate( EName     )
   !
   ntypeMol   = 13 ! 1: CA; 2: HA; 3: C1; 4: O; 5: NH; 6: HN
                   ! 7: Ct; 8: HT; 9: C2; 10: Oa; 11: OH; 12: HO; 13: CT
   nbndtypMol = 12 ! 1: CA-HA 2: C1-CA 3: C1-Ox 4: C1-NH 5: HN-NH 6: Ct-NH
                   ! 7: Ct-HT 8: C2-Ct 3: C2-OA 9: C2-OH 10: HO-OH 11: CT-Ct 7: CT-HT 12: CA-CT
   nangtypMol = 19 ! 1: CA-CA-HA  2: C1-CA-CA 3: CA-C1-Ox 4: CA-C1-NH 5: NH-C1-Ox 
                   ! 6: C1-NH-HN  7: C1-NH-Ct 8: Ct-NH-HN 9: HT-Ct-NH 10: C2-Ct-NH 
                   ! 11: CT-Ct-NH 9: C2-Ct-HT 12: CT-Ct-HT 13: C2-Ct-CT 
                   ! 3: Ct-C2-OA 14: Ct-C2-OH 15: OA-C2-OH 16: C2-OH-HO 
                   !12: Ct-CT-HT 17: CA-CT-Ct 18: HT-CT-HT  9: CA-CT-HT 19: CA-CA-CT
   ndihtypMol = 18 ! 1: CA-CA-CA-HA 1: C1-CA-CA-CA 1: C1-CA-CA-HA 1: HA-CA-CA-HA
                   ! 2: Ox-C1-CA-CA 3: NH-C1-CA-CA 4: CA-C1-NH-HN 4: Ox-C1-NH-HN
                   ! 5: CA-C1-NH-Ct 6: Ox-C1-NH-Ct 5: HT-Ct-NH-C1 7: C2-Ct-NH-C1
                   ! 7: CT-Ct-NH-C1 7: CT-Ct-NH-HN 8: OA-C2-Ct-CT 9: OH-C2-Ct-NH
                   !10: OH-C2-Ct-CT 11: Ct-C2-OH-HO 12: OA-C2-OH-HO 13: HT-CT-Ct-NH
                   !14: HT-CT-Ct-HT 15: HT-CT-Ct-C2 16: CA-CT-Ct-NH 17: CA-CT-Ct-HT
                   !18: CA-CT-Ct-C2 1: CA-CA-CA-CT 1: CT-CA-CA-HA
   allocate( EMass(ntypeMol), sigma(ntypeMol), epison(ntypeMol),           &
   &         bondcoef(2, nbndtypMol), anglcoef(2, nangtypMol),             &
   &         torscoef(4, ndihtypMol), DistMin(ntypeMol), EName(ntypeMol+1) )
   EMass = 12.0107D0
   EMass( 2) = 1.00794D0
   EMass( 6) = 1.00794D0
   EMass( 8) = 1.00794D0
   EMass(12) = 1.00794D0
   EMass( 4) = 15.9994D0
   EMass(10) = 15.9994D0;
   EMass(11) = 15.9994D0;
   EMass(5) = 14.0067D0
   sigma      = 0.D0; epison     = 0.D0
   sigma( 1)  = 3.55; epison( 1) = 0.07
   sigma( 2)  = 2.42; epison( 2) = 0.03
   sigma( 3)  = 3.75; epison( 3) = 0.105
   sigma( 4)  = 2.96; epison( 4) = 0.21
   sigma( 5)  = 3.25; epison( 5) = 0.17
   sigma( 7)  = 3.50; epison( 7) = 0.066
   sigma( 8)  = 2.50; epison( 8) = 0.03
   sigma( 9)  = 3.75; epison( 9) = 0.105
   sigma(10)  = 2.96; epison(10) = 0.21
   sigma(11)  = 3.00; epison(11) = 0.17
   sigma(13)  = 3.50; epison(13) = 0.066

   DistMin = 1.8D0
   DistMin( 2) = 1.1D0
   DistMin( 6) = 1.1D0
   DistMin( 8) = 1.1D0
   DistMin(12) = 1.1D0
   DistMin( 4) = 1.9D0
   DistMin(10) = 1.9D0
   DistMin(11) = 1.9D0
   DistMin( 5) = 1.6D0
   EName = "C"
   EName( 2) = "H"
   EName( 6) = "H"
   EName( 8) = "H"
   EName(12) = "H"
   EName( 4) = "O"
   EName(10) = "O"
   EName(11) = "O"
   EName( 5) = "N"
   write(*,*) EName
   !
   bondcoef = reshape( (/ 367.00D0, 1.080D0,& ! 1 CA-HA
   &                      400.00D0, 1.490D0,& ! 2 C -CA
   &                      570.00D0, 1.229D0,& ! 3 C =O   
   &                      490.00D0, 1.335D0,& ! 4 =C-NH
   &                      434.00D0, 1.010D0,& ! 5 HN-NH
   &                      337.00D0, 1.449D0,& ! 6 CT-NH
   &                      340.00D0, 1.090D0,& ! 7 CT-HC
   &                      317.00D0, 1.522D0,& ! 8 =C-CT
   &                      450.00D0, 1.364D0,& ! 9 =C-OH
   &                      553.00D0, 0.945D0,& !10 HO-OH
   &                      268.00D0, 1.529D0,& !11 CT-CT
   &                      317.00D0, 1.510D0 & !12 CA-CT
   &                     /), (/2, nbndtypMol/) )
   anglcoef = reshape( (/ 35.0D0, 120.0D0,  & ! 1 CA-CA-HA
   &                      85.0D0, 120.0D0,  & ! 2 =C-CA-CA
   &                      80.0D0, 120.4D0,  & ! 3 CA-C=-O CT-C=-O
   &                      70.0D0, 115.5D0,  & ! 4 CA-C=-NH
   &                      80.0D0, 122.9D0,  & ! 5 NH-C=-O 
   &                      35.0D0, 119.8D0,  & ! 6 =C-NH-HN
   &                      50.0D0, 121.9D0,  & ! 7 =C-NH-CT
   &                      38.0D0, 118.4D0,  & ! 8 CT-NH-HN
   &                      35.0D0, 109.5D0,  & ! 9 CA-CT-HC HT-CT-NH =C-CT-HC
   &                      63.0D0, 110.1D0,  & !10 =C-CT-NH
   &                      80.0D0, 109.7D0,  & !11 CT-CT-NH
   &                      37.5D0, 110.7D0,  & !12 CT-CT-HT
   &                      63.0D0, 111.1D0,  & !13 =C-CT-CT
   &                      70.0D0, 108.0D0,  & !14 CT-C=-OH
   &                      80.0D0, 121.0D0,  & !15  O=C -OH
   &                      35.0D0, 113.0D0,  & !16 =C-OH-HO
   &                      63.0D0, 114.0D0,  & !17 CA-CT-CT
   &                      33.0D0, 107.8D0,  & !18 HT-CT-HT
   &                      70.0D0, 120.0D0   & !19 CA-CA-CT
   &                      /), (/2, nangtypMol/) )
   !
   torscoef = reshape( (/ 0.000D0,  7.250D0,  0.000D0, 0.000D0,  & ! 1 CA-CA-CA-HA
   &                      0.000D0,  2.100D0,  0.000D0, 0.000D0,  & ! 2  O=C -CA-CA
   &                      0.000D0,  1.100D0,  0.000D0, 0.000D0,  & ! 3 NH-C -CA-CA
   &                      0.000D0,  4.900D0,  0.000D0, 0.000D0,  & ! 4 CA-C -NH-HN
   &                      2.300D0,  6.089D0,  0.000D0, 0.000D0,  & ! 5 CA-C -NH-CT
   &                      0.000D0,  6.089D0,  0.000D0, 0.000D0,  & ! 6  O=C -NH-CT
   &                      2.859D0,  2.058D0,-11.266D0, 0.000D0,  & ! 7  C-CT-NH-C 
   &                      0.000D0,  1.166D0,  0.000D0, 0.000D0,  & ! 8  O=C -CT-CT
   &                      5.260D0,  0.820D0,  0.000D0, 0.000D0,  & ! 9 OH-C -CT-NH
   &                      1.000D0,  0.546D0,  0.450D0, 0.000D0,  & !10 OH-C -CT-CT
   &                      1.500D0,  5.500D0,  0.000D0, 0.000D0,  & !11 CT-C -OH-HO
   &                      0.000D0,  5.000D0,  0.000D0, 0.000D0,  & !12  O=C -OH-HO
   &                      0.000D0,  0.000D0,  0.464D0, 0.000D0,  & !13 HC-CT-CT-NH
   &                      0.000D0,  0.000D0,  0.300D0, 0.000D0,  & !14 HC-CT-CT-HC
   &                      0.000D0,  0.000D0, -0.100D0, 0.000D0,  & !15 HT-CT-CT-C=
   &                     -0.800D0,  0.000D0,  0.000D0, 0.000D0,  & !16 CA-CT-CT-NH
   &                      0.000D0,  0.000D0,  0.462D0, 0.000D0,  & !17 CA-CT-CT-HC
   &                     -1.697D0, -0.456D0,  0.585D0, 0.000D0   & !18 CA-CT-CT-C 
   &                      /), (/4, ndihtypMol/) )
   !=========================================================================
   ! Dye molecule from Feng Chuan Liang
   !=========================================================================
   molform    = '<=>-++N-CO-<=>-CO-N++<=>'
   molname    = 'DyeMol'
   den0       = 1.08D0
   natomMol   = 58
   nbondsMol  = 42
   nanglsMol  = 80
   ndihrsMol  = 106
   !
   allocate( bondsMol(3, nbondsMol), AnglsMol(4, nanglsMol),                &
   &         dihrsMol(5, ndihrsMol), attypMol(natomMol),                    &
   &         atposMol(3,natomMol), chargeMol(natomMol), molIDMol(natomMol) )                
   !
   attypMol = (/ 1,  1,  1,  1,  1,  1,  2,  2,  2,  2, &
   &             3,  4,  5,  6,  7,  8,  9, 10, 11, 12, &
   &            13,  8,  8,  1,  1,  1,  1,  1,  1,  2, &
   &             2,  2,  2,  2,  3,  4,  5,  6,  7,  8, &
   &             9, 10, 11, 12, 13,  8,  8,  1,  1,  1, &
   &             1,  1,  1,  2,  2,  2,  2,  2 /)
   !
   atposMol(:, 1)= (/  -2.30800D0,   1.84184D0,   0.07991D0 /)
   atposMol(:, 2)= (/  -2.89040D0,   0.75590D0,   0.74440D0 /)
   atposMol(:, 3)= (/  -3.65196D0,   0.98168D0,   1.89725D0 /)
   atposMol(:, 4)= (/  -3.82970D0,   2.28308D0,   2.38176D0 /)
   atposMol(:, 5)= (/  -3.24730D0,   3.36902D0,   1.71727D0 /)
   atposMol(:, 6)= (/  -2.48574D0,   3.14324D0,   0.56442D0 /)
   atposMol(:, 7)= (/  -1.73430D0,   1.66990D0,  -0.78880D0 /)
   atposMol(:, 8)= (/  -4.09200D0,   0.16820D0,   2.40050D0 /)
   atposMol(:, 9)= (/  -4.40050D0,   2.43720D0,   3.24350D0 /)
   atposMol(:,10)= (/  -2.04310D0,   3.93970D0,   0.05450D0 /)
   atposMol(:,11)= (/  -2.68130D0,  -0.60460D0,   0.20390D0 /)
   atposMol(:,12)= (/  -1.99390D0,  -0.72000D0,  -0.81790D0 /)
   atposMol(:,13)= (/  -3.22020D0,  -1.68880D0,   0.80290D0 /)
   atposMol(:,14)= (/  -3.76540D0,  -1.57590D0,   1.61700D0 /)
   atposMol(:,15)= (/  -3.03300D0,  -3.04260D0,   0.29420D0 /)
   atposMol(:,16)= (/  -3.65150D0,  -3.70760D0,   0.91260D0 /)
   atposMol(:,17)= (/  -3.50840D0,  -3.09900D0,  -1.13900D0 /)
   atposMol(:,18)= (/  -4.70020D0,  -3.31570D0,  -1.38160D0 /)
   atposMol(:,19)= (/  -2.61350D0,  -2.90340D0,  -2.18680D0 /)
   atposMol(:,20)= (/  -3.09420D0,  -2.97310D0,  -3.04700D0 /)
   atposMol(:,21)= (/  -1.52580D0,  -3.42330D0,   0.38480D0 /)
   atposMol(:,22)= (/  -0.92120D0,  -2.73440D0,  -0.21990D0 /)
   atposMol(:,23)= (/  -1.25650D0,  -3.35840D0,   1.44760D0 /)
   atposMol(:,24)= (/  -1.33365D0,  -4.83711D0,  -0.07624D0 /)
   atposMol(:,25)= (/  -0.57880D0,  -5.08940D0,  -1.22800D0 /)
   atposMol(:,26)= (/  -0.39021D0,  -6.40482D0,  -1.66856D0 /)
   atposMol(:,27)= (/  -0.95694D0,  -7.46885D0,  -0.95676D0 /)
   atposMol(:,28)= (/  -1.71178D0,  -7.21657D0,   0.19501D0 /)
   atposMol(:,29)= (/  -1.90038D0,  -5.90114D0,   0.63556D0 /)
   atposMol(:,30)= (/  -0.15160D0,  -4.28240D0,  -1.76690D0 /)
   atposMol(:,31)= (/   0.17930D0,  -6.58510D0,  -2.53840D0 /)
   atposMol(:,32)= (/  -0.80980D0,  -8.44840D0,  -1.29120D0 /)
   atposMol(:,33)= (/  -2.12740D0,  -8.00850D0,   0.72750D0 /)
   atposMol(:,34)= (/  -2.45750D0,  -5.70760D0,   1.49880D0 /)
   atposMol(:,35)= (/  -3.44990D0,   4.70980D0,   2.24550D0 /)
   atposMol(:,36)= (/  -4.13070D0,   4.85220D0,   3.26750D0 /)
   atposMol(:,37)= (/  -2.92280D0,   5.78690D0,   1.65620D0 /)
   atposMol(:,38)= (/  -2.37590D0,   5.70250D0,   0.83780D0 /)
   atposMol(:,39)= (/  -3.15260D0,   7.08310D0,   2.21300D0 /)
   atposMol(:,40)= (/  -3.43090D0,   7.03900D0,   3.27450D0 /)
   atposMol(:,41)= (/  -1.96380D0,   7.96710D0,   1.97940D0 /)
   atposMol(:,42)= (/  -1.34910D0,   7.90510D0,   0.90940D0 /)
   atposMol(:,43)= (/  -1.56000D0,   8.86130D0,   2.96440D0 /)
   atposMol(:,44)= (/  -2.16140D0,   8.78270D0,   3.74690D0 /)
   atposMol(:,45)= (/  -4.34090D0,   7.67260D0,   1.41780D0 /)
   atposMol(:,46)= (/  -4.08350D0,   7.71760D0,   0.35070D0 /)
   atposMol(:,47)= (/  -5.19550D0,   7.00530D0,   1.59540D0 /)
   atposMol(:,48)= (/  -4.66432D0,   9.04363D0,   1.92796D0 /)
   atposMol(:,49)= (/  -5.19210D0,   9.20170D0,   3.21500D0 /)
   atposMol(:,50)= (/  -5.49614D0,  10.48124D0,   3.69494D0 /)
   atposMol(:,51)= (/  -5.27235D0,  11.60295D0,   2.88767D0 /)
   atposMol(:,52)= (/  -4.74457D0,  11.44487D0,   1.60063D0 /)
   atposMol(:,53)= (/  -4.44053D0,  10.16534D0,   1.12069D0 /)
   atposMol(:,54)= (/  -5.36100D0,   8.35210D0,   3.82730D0 /)
   atposMol(:,55)= (/  -5.89260D0,  10.59120D0,   4.66660D0 /)
   atposMol(:,56)= (/  -5.50370D0,  12.55470D0,   3.25310D0 /)
   atposMol(:,57)= (/  -4.58400D0,  12.27840D0,   0.99850D0 /)
   atposMol(:,58)= (/  -4.05150D0,  10.03810D0,   0.15920D0 /)
   !
   chargeMol = (/  -0.115D0, -0.115D0, -0.115D0, -0.115D0, -0.115D0, -0.115D0, &
   &                0.115D0,  0.115D0,  0.115D0,  0.115D0,  0.615D0, -0.500D0, &
   &               -0.500D0,  0.300D0,  0.140D0,  0.060D0,  0.520D0, -0.440D0, &
   &               -0.530D0,  0.450D0, -0.005D0,  0.060D0,  0.060D0, -0.115D0, & 
   &               -0.115D0, -0.115D0, -0.115D0, -0.115D0, -0.115D0,  0.115D0, &
   &                0.115D0,  0.115D0,  0.115D0,  0.115D0,  0.615D0, -0.500D0, &
   &               -0.500D0,  0.300D0,  0.140D0,  0.060D0,  0.520D0, -0.440D0, &
   &               -0.530D0,  0.450D0, -0.005D0,  0.060D0,  0.060D0, -0.115D0, &
   &               -0.115D0, -0.115D0, -0.115D0, -0.115D0, -0.115D0,  0.115D0, &
   &                0.115D0,  0.115D0,  0.115D0,  0.115D0 /)
   !                 Type, atom 1, atom 2
   bondsMol(:,  1) = (/  1,   7,   1/)
   bondsMol(:,  2) = (/  1,   8,   3/)
   bondsMol(:,  3) = (/  1,   9,   4/)
   bondsMol(:,  4) = (/  1,  10,   6/)
   bondsMol(:,  5) = (/  2,  11,   2/)
   bondsMol(:,  6) = (/  3,  12,  11/)
   bondsMol(:,  7) = (/  4,  13,  11/)
   bondsMol(:,  8) = (/  5,  14,  13/)
   bondsMol(:,  9) = (/  6,  15,  13/)
   bondsMol(:, 10) = (/  7,  16,  15/)
   bondsMol(:, 11) = (/  8,  17,  15/)
   bondsMol(:, 12) = (/  3,  18,  17/)
   bondsMol(:, 13) = (/  9,  19,  17/)
   bondsMol(:, 14) = (/ 10,  20,  19/)
   bondsMol(:, 15) = (/ 11,  21,  15/)
   bondsMol(:, 16) = (/  7,  22,  21/)
   bondsMol(:, 17) = (/  7,  23,  21/)
   bondsMol(:, 18) = (/ 12,  24,  21/)
   bondsMol(:, 19) = (/  1,  30,  25/)
   bondsMol(:, 20) = (/  1,  31,  26/)
   bondsMol(:, 21) = (/  1,  32,  27/)
   bondsMol(:, 22) = (/  1,  33,  28/)
   bondsMol(:, 23) = (/  1,  34,  29/)
   bondsMol(:, 24) = (/  2,  35,   5/)
   bondsMol(:, 25) = (/  3,  36,  35/)
   bondsMol(:, 26) = (/  4,  37,  35/)
   bondsMol(:, 27) = (/  5,  38,  37/)
   bondsMol(:, 28) = (/  6,  39,  37/)
   bondsMol(:, 29) = (/  7,  40,  39/)
   bondsMol(:, 30) = (/  8,  41,  39/)
   bondsMol(:, 31) = (/  3,  42,  41/)
   bondsMol(:, 32) = (/  9,  43,  41/)
   bondsMol(:, 33) = (/ 10,  44,  43/)
   bondsMol(:, 34) = (/ 11,  45,  39/)
   bondsMol(:, 35) = (/  7,  46,  45/)
   bondsMol(:, 36) = (/  7,  47,  45/)
   bondsMol(:, 37) = (/ 12,  48,  45/)
   bondsMol(:, 38) = (/  1,  54,  49/)
   bondsMol(:, 39) = (/  1,  55,  50/)
   bondsMol(:, 40) = (/  1,  56,  51/)
   bondsMol(:, 41) = (/  1,  57,  52/)
   bondsMol(:, 42) = (/  1,  58,  53/)
   !                  Type,  atom1,  atom2, atom3
   AnglsMol(:,  1) = (/  1,   2,   1,   7 /)
   AnglsMol(:,  2) = (/  1,   6,   1,   7 /)
   AnglsMol(:,  3) = (/  2,   1,   2,  11 /)
   AnglsMol(:,  4) = (/  2,   3,   2,  11 /)
   AnglsMol(:,  5) = (/  1,   2,   3,   8 /)
   AnglsMol(:,  6) = (/  1,   4,   3,   8 /)
   AnglsMol(:,  7) = (/  1,   3,   4,   9 /)
   AnglsMol(:,  8) = (/  1,   5,   4,   9 /)
   AnglsMol(:,  9) = (/  2,   4,   5,  35 /)
   AnglsMol(:, 10) = (/  2,   6,   5,  35 /)
   AnglsMol(:, 11) = (/  1,   1,   6,  10 /)
   AnglsMol(:, 12) = (/  1,   5,   6,  10 /)
   AnglsMol(:, 13) = (/  3,   2,  11,  12 /)
   AnglsMol(:, 14) = (/  4,   2,  11,  13 /)
   AnglsMol(:, 15) = (/  5,  12,  11,  13 /)
   AnglsMol(:, 16) = (/  6,  11,  13,  14 /)
   AnglsMol(:, 17) = (/  7,  11,  13,  15 /)
   AnglsMol(:, 18) = (/  8,  14,  13,  15 /)
   AnglsMol(:, 19) = (/  9,  13,  15,  16 /)
   AnglsMol(:, 20) = (/ 10,  13,  15,  17 /)
   AnglsMol(:, 21) = (/ 11,  13,  15,  21 /)
   AnglsMol(:, 22) = (/  9,  16,  15,  17 /)
   AnglsMol(:, 23) = (/ 12,  16,  15,  21 /)
   AnglsMol(:, 24) = (/ 13,  17,  15,  21 /)
   AnglsMol(:, 25) = (/  3,  15,  17,  18 /)
   AnglsMol(:, 26) = (/ 14,  15,  17,  19 /)
   AnglsMol(:, 27) = (/ 15,  18,  17,  19 /)
   AnglsMol(:, 28) = (/ 16,  17,  19,  20 /)
   AnglsMol(:, 29) = (/ 12,  15,  21,  22 /)
   AnglsMol(:, 30) = (/ 12,  15,  21,  23 /)
   AnglsMol(:, 31) = (/ 17,  15,  21,  24 /)
   AnglsMol(:, 32) = (/ 18,  22,  21,  23 /)
   AnglsMol(:, 33) = (/  9,  22,  21,  24 /)
   AnglsMol(:, 34) = (/  9,  23,  21,  24 /)
   AnglsMol(:, 35) = (/ 19,  21,  24,  25 /)
   AnglsMol(:, 36) = (/ 19,  21,  24,  29 /)
   AnglsMol(:, 37) = (/  1,  24,  25,  30 /)
   AnglsMol(:, 38) = (/  1,  26,  25,  30 /)
   AnglsMol(:, 39) = (/  1,  25,  26,  31 /)
   AnglsMol(:, 40) = (/  1,  27,  26,  31 /)
   AnglsMol(:, 41) = (/  1,  26,  27,  32 /)
   AnglsMol(:, 42) = (/  1,  28,  27,  32 /)
   AnglsMol(:, 43) = (/  1,  27,  28,  33 /)
   AnglsMol(:, 44) = (/  1,  29,  28,  33 /)
   AnglsMol(:, 45) = (/  1,  24,  29,  34 /)
   AnglsMol(:, 46) = (/  1,  28,  29,  34 /)
   AnglsMol(:, 47) = (/  3,   5,  35,  36 /)
   AnglsMol(:, 48) = (/  4,   5,  35,  37 /)
   AnglsMol(:, 49) = (/  5,  36,  35,  37 /)
   AnglsMol(:, 50) = (/  6,  35,  37,  38 /)
   AnglsMol(:, 51) = (/  7,  35,  37,  39 /)
   AnglsMol(:, 52) = (/  8,  38,  37,  39 /)
   AnglsMol(:, 53) = (/  9,  37,  39,  40 /)
   AnglsMol(:, 54) = (/ 10,  37,  39,  41 /)
   AnglsMol(:, 55) = (/ 11,  37,  39,  45 /)
   AnglsMol(:, 56) = (/  9,  40,  39,  41 /)
   AnglsMol(:, 57) = (/ 12,  40,  39,  45 /)
   AnglsMol(:, 58) = (/ 13,  41,  39,  45 /)
   AnglsMol(:, 59) = (/  3,  39,  41,  42 /)
   AnglsMol(:, 60) = (/ 14,  39,  41,  43 /)
   AnglsMol(:, 61) = (/ 15,  42,  41,  43 /)
   AnglsMol(:, 62) = (/ 16,  41,  43,  44 /)
   AnglsMol(:, 63) = (/ 12,  39,  45,  46 /)
   AnglsMol(:, 64) = (/ 12,  39,  45,  47 /)
   AnglsMol(:, 65) = (/ 17,  39,  45,  48 /)
   AnglsMol(:, 66) = (/ 18,  46,  45,  47 /)
   AnglsMol(:, 67) = (/  9,  46,  45,  48 /)
   AnglsMol(:, 68) = (/  9,  47,  45,  48 /)
   AnglsMol(:, 69) = (/ 19,  45,  48,  49 /)
   AnglsMol(:, 70) = (/ 19,  45,  48,  53 /)
   AnglsMol(:, 71) = (/  1,  48,  49,  54 /)
   AnglsMol(:, 72) = (/  1,  50,  49,  54 /)
   AnglsMol(:, 73) = (/  1,  49,  50,  55 /)
   AnglsMol(:, 74) = (/  1,  51,  50,  55 /)
   AnglsMol(:, 75) = (/  1,  50,  51,  56 /)
   AnglsMol(:, 76) = (/  1,  52,  51,  56 /)
   AnglsMol(:, 77) = (/  1,  51,  52,  57 /)
   AnglsMol(:, 78) = (/  1,  53,  52,  57 /)
   AnglsMol(:, 79) = (/  1,  52,  53,  58 /)
   AnglsMol(:, 80) = (/  1,  48,  53,  58 /)

   !         Type, atom1, atom2, atom3, atom4
   DihrsMol(:,   1 ) = (/   1,    3,    2,    1,    7 /)
   DihrsMol(:,   2 ) = (/   1,   11,    2,    1,    6 /)
   DihrsMol(:,   3 ) = (/   1,   11,    2,    1,    7 /)
   DihrsMol(:,   4 ) = (/   1,    4,    3,    2,   11 /)
   DihrsMol(:,   5 ) = (/   1,    8,    3,    2,    1 /)
   DihrsMol(:,   6 ) = (/   1,    8,    3,    2,   11 /)
   DihrsMol(:,   7 ) = (/   1,    5,    4,    3,    8 /)
   DihrsMol(:,   8 ) = (/   1,    9,    4,    3,    2 /)
   DihrsMol(:,   9 ) = (/   1,    9,    4,    3,    8 /)
   DihrsMol(:,  10 ) = (/   1,    6,    5,    4,    9 /)
   DihrsMol(:,  11 ) = (/   1,   35,    5,    4,    3 /)
   DihrsMol(:,  12 ) = (/   1,   35,    5,    4,    9 /)
   DihrsMol(:,  13 ) = (/   1,    5,    6,    1,    7 /)
   DihrsMol(:,  14 ) = (/   1,   10,    6,    1,    2 /)
   DihrsMol(:,  15 ) = (/   1,   10,    6,    1,    7 /)
   DihrsMol(:,  16 ) = (/   1,    1,    6,    5,   35 /)
   DihrsMol(:,  17 ) = (/   1,   10,    6,    5,    4 /)
   DihrsMol(:,  18 ) = (/   1,   10,    6,    5,   35 /)
   DihrsMol(:,  19 ) = (/   2,   12,   11,    2,    1 /)
   DihrsMol(:,  20 ) = (/   2,   12,   11,    2,    3 /)
   DihrsMol(:,  21 ) = (/   3,   13,   11,    2,    1 /)
   DihrsMol(:,  22 ) = (/   3,   13,   11,    2,    3 /)
   DihrsMol(:,  23 ) = (/   4,   14,   13,   11,    2 /)
   DihrsMol(:,  24 ) = (/   4,   14,   13,   11,   12 /)
   DihrsMol(:,  25 ) = (/   5,   15,   13,   11,    2 /)
   DihrsMol(:,  26 ) = (/   6,   15,   13,   11,   12 /)
   DihrsMol(:,  27 ) = (/   5,   16,   15,   13,   11 /)
   DihrsMol(:,  28 ) = (/   7,   17,   15,   13,   11 /)
   DihrsMol(:,  29 ) = (/   7,   21,   15,   13,   11 /)
   DihrsMol(:,  30 ) = (/   7,   21,   15,   13,   14 /)
   DihrsMol(:,  31 ) = (/   8,   18,   17,   15,   21 /)
   DihrsMol(:,  32 ) = (/   9,   19,   17,   15,   13 /)
   DihrsMol(:,  33 ) = (/  10,   19,   17,   15,   21 /)
   DihrsMol(:,  34 ) = (/  11,   20,   19,   17,   15 /)
   DihrsMol(:,  35 ) = (/  12,   20,   19,   17,   18 /)
   DihrsMol(:,  36 ) = (/  13,   22,   21,   15,   13 /)
   DihrsMol(:,  37 ) = (/  14,   22,   21,   15,   16 /)
   DihrsMol(:,  38 ) = (/  15,   22,   21,   15,   17 /)
   DihrsMol(:,  39 ) = (/  13,   23,   21,   15,   13 /)
   DihrsMol(:,  40 ) = (/  14,   23,   21,   15,   16 /)
   DihrsMol(:,  41 ) = (/  15,   23,   21,   15,   17 /)
   DihrsMol(:,  42 ) = (/  16,   24,   21,   15,   13 /)
   DihrsMol(:,  43 ) = (/  17,   24,   21,   15,   16 /)
   DihrsMol(:,  44 ) = (/  18,   24,   21,   15,   17 /)
   DihrsMol(:,  45 ) = (/   1,   26,   25,   24,   21 /)
   DihrsMol(:,  46 ) = (/   1,   30,   25,   24,   21 /)
   DihrsMol(:,  47 ) = (/   1,   30,   25,   24,   29 /)
   DihrsMol(:,  48 ) = (/   1,   27,   26,   25,   30 /)
   DihrsMol(:,  49 ) = (/   1,   31,   26,   25,   24 /)
   DihrsMol(:,  50 ) = (/   1,   31,   26,   25,   30 /)
   DihrsMol(:,  51 ) = (/   1,   28,   27,   26,   31 /)
   DihrsMol(:,  52 ) = (/   1,   32,   27,   26,   25 /)
   DihrsMol(:,  53 ) = (/   1,   32,   27,   26,   31 /)
   DihrsMol(:,  54 ) = (/   1,   29,   28,   27,   32 /)
   DihrsMol(:,  55 ) = (/   1,   33,   28,   27,   26 /)
   DihrsMol(:,  56 ) = (/   1,   33,   28,   27,   32 /)
   DihrsMol(:,  57 ) = (/   1,   28,   29,   24,   21 /)
   DihrsMol(:,  58 ) = (/   1,   34,   29,   24,   21 /)
   DihrsMol(:,  59 ) = (/   1,   34,   29,   24,   25 /)
   DihrsMol(:,  60 ) = (/   1,   24,   29,   28,   33 /)
   DihrsMol(:,  61 ) = (/   1,   34,   29,   28,   27 /)
   DihrsMol(:,  62 ) = (/   1,   34,   29,   28,   33 /)
   DihrsMol(:,  63 ) = (/   2,   36,   35,    5,    4 /)
   DihrsMol(:,  64 ) = (/   2,   36,   35,    5,    6 /)
   DihrsMol(:,  65 ) = (/   3,   37,   35,    5,    4 /)
   DihrsMol(:,  66 ) = (/   3,   37,   35,    5,    6 /)
   DihrsMol(:,  67 ) = (/   4,   38,   37,   35,    5 /)
   DihrsMol(:,  68 ) = (/   4,   38,   37,   35,   36 /)
   DihrsMol(:,  69 ) = (/   5,   39,   37,   35,    5 /)
   DihrsMol(:,  70 ) = (/   6,   39,   37,   35,   36 /)
   DihrsMol(:,  71 ) = (/   5,   40,   39,   37,   35 /)
   DihrsMol(:,  72 ) = (/   7,   41,   39,   37,   35 /)
   DihrsMol(:,  73 ) = (/   7,   45,   39,   37,   35 /)
   DihrsMol(:,  74 ) = (/   7,   45,   39,   37,   38 /)
   DihrsMol(:,  75 ) = (/   8,   42,   41,   39,   45 /)
   DihrsMol(:,  76 ) = (/   9,   43,   41,   39,   37 /)
   DihrsMol(:,  77 ) = (/  10,   43,   41,   39,   45 /)
   DihrsMol(:,  78 ) = (/  11,   44,   43,   41,   39 /)
   DihrsMol(:,  79 ) = (/  12,   44,   43,   41,   42 /)
   DihrsMol(:,  80 ) = (/  13,   46,   45,   39,   37 /)
   DihrsMol(:,  81 ) = (/  14,   46,   45,   39,   40 /)
   DihrsMol(:,  82 ) = (/  15,   46,   45,   39,   41 /)
   DihrsMol(:,  83 ) = (/  13,   47,   45,   39,   37 /)
   DihrsMol(:,  84 ) = (/  14,   47,   45,   39,   40 /)
   DihrsMol(:,  85 ) = (/  15,   47,   45,   39,   41 /)
   DihrsMol(:,  86 ) = (/  16,   48,   45,   39,   37 /)
   DihrsMol(:,  87 ) = (/  17,   48,   45,   39,   40 /)
   DihrsMol(:,  88 ) = (/  18,   48,   45,   39,   41 /)
   DihrsMol(:,  89 ) = (/   1,   50,   49,   48,   45 /)
   DihrsMol(:,  90 ) = (/   1,   54,   49,   48,   45 /)
   DihrsMol(:,  91 ) = (/   1,   54,   49,   48,   53 /)
   DihrsMol(:,  92 ) = (/   1,   51,   50,   49,   54 /)
   DihrsMol(:,  93 ) = (/   1,   55,   50,   49,   48 /)
   DihrsMol(:,  94 ) = (/   1,   55,   50,   49,   54 /)
   DihrsMol(:,  95 ) = (/   1,   52,   51,   50,   55 /)
   DihrsMol(:,  96 ) = (/   1,   56,   51,   50,   49 /)
   DihrsMol(:,  97 ) = (/   1,   56,   51,   50,   55 /)
   DihrsMol(:,  98 ) = (/   1,   53,   52,   51,   56 /)
   DihrsMol(:,  99 ) = (/   1,   57,   52,   51,   50 /)
   DihrsMol(:, 100 ) = (/   1,   57,   52,   51,   56 /)
   DihrsMol(:, 101 ) = (/   1,   48,   53,   52,   57 /)
   DihrsMol(:, 102 ) = (/   1,   58,   53,   52,   51 /)
   DihrsMol(:, 103 ) = (/   1,   58,   53,   52,   57 /)
   DihrsMol(:, 104 ) = (/   1,   52,   53,   48,   45 /)
   DihrsMol(:, 105 ) = (/   1,   58,   53,   48,   45 /)
   DihrsMol(:, 106 ) = (/   1,   58,   53,   48,   49 /)
   !
   molIDMol  = (/ 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, &
   &              4, 4, 4, 4, 4, 4, 4, 4, 4, 4, &
   &              4, 4, 4, 2, 2, 2, 2, 2, 2, 4, &
   &              4, 4, 4, 4, 4, 4, 4, 4, 4, 4, &
   &              4, 4, 4, 4, 4, 4, 4, 3, 3, 3, &
   &              3, 3, 3, 4, 4, 4, 4, 4 /)
   nMol      = maxval(molIDMol)
   molmass   = 0.D0
   do i = 1, natomMol
      molmass = molmass + EMass( attypMol(i) )
   enddo
   forall ( i=1:3 ) minbox(i) = maxval(atposMol(i,:)) - minval(atposMol(i,:))
   minlen = maxval( minbox )
   allocate( rotatedMol( 3, natomMol) )
   !
   subname = subnamep
return
end subroutine
